From: Keir Fraser Date: Wed, 20 Oct 2010 08:56:36 +0000 (+0100) Subject: x86 hvm: Improve test for wait-for-SIPI state of a target VLAPIC. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11377 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=5e7e62992dc51712679372354dbfcb95715eb346;p=xen.git x86 hvm: Improve test for wait-for-SIPI state of a target VLAPIC. This fixes a livelock in hvmloader with credit2 scheduler, whereby an AP can be brought online, do its work, and shut itself down, before the BSP re-emulates the VLAPIC write that sent the SIPI. BSP then ends up in an endless re-emulation work where it sees the target vcpu is down, therefore schedules a tasklet, which does no work because the vcpu is already initialised. The fix is to check v->is_initialised rather than VPF_down, before scheduling the tasklet. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index da513de052..3274d4deda 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -312,8 +312,8 @@ static int vlapic_accept_irq(struct vcpu *v, uint32_t icr_low) break; case APIC_DM_STARTUP: - /* Nothing to do if the VCPU is not on its way down. */ - if ( !test_bit(_VPF_down, &v->pause_flags) ) + /* Nothing to do if the VCPU is already initialised. */ + if ( v->is_initialised ) break; rc = vlapic_schedule_init_sipi_tasklet(v, icr_low); break;